/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.mto.module.karaoke.service.persistence;

import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil;
import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.kernel.util.ReferenceRegistry;
import com.liferay.portal.service.ServiceContext;

import com.mto.module.karaoke.model.UserSongs;

import java.util.List;

/**
 * The persistence utility for the user songs service. This utility wraps {@link UserSongsPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
 *
 * <p>
 * Caching information and settings can be found in <code>portal.properties</code>
 * </p>
 *
 * @author vuonglm
 * @see UserSongsPersistence
 * @see UserSongsPersistenceImpl
 * @generated
 */
public class UserSongsUtil {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
	 */

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
	 */
	public static void clearCache() {
		getPersistence().clearCache();
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
	 */
	public static void clearCache(UserSongs userSongs) {
		getPersistence().clearCache(userSongs);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
	 */
	public long countWithDynamicQuery(DynamicQuery dynamicQuery)
		throws SystemException {
		return getPersistence().countWithDynamicQuery(dynamicQuery);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
	 */
	public static List<UserSongs> findWithDynamicQuery(
		DynamicQuery dynamicQuery) throws SystemException {
		return getPersistence().findWithDynamicQuery(dynamicQuery);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
	 */
	public static List<UserSongs> findWithDynamicQuery(
		DynamicQuery dynamicQuery, int start, int end)
		throws SystemException {
		return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
	 */
	public static List<UserSongs> findWithDynamicQuery(
		DynamicQuery dynamicQuery, int start, int end,
		OrderByComparator orderByComparator) throws SystemException {
		return getPersistence()
				   .findWithDynamicQuery(dynamicQuery, start, end,
			orderByComparator);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
	 */
	public static UserSongs update(UserSongs userSongs, boolean merge)
		throws SystemException {
		return getPersistence().update(userSongs, merge);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
	 */
	public static UserSongs update(UserSongs userSongs, boolean merge,
		ServiceContext serviceContext) throws SystemException {
		return getPersistence().update(userSongs, merge, serviceContext);
	}

	/**
	* Caches the user songs in the entity cache if it is enabled.
	*
	* @param userSongs the user songs
	*/
	public static void cacheResult(
		com.mto.module.karaoke.model.UserSongs userSongs) {
		getPersistence().cacheResult(userSongs);
	}

	/**
	* Caches the user songses in the entity cache if it is enabled.
	*
	* @param userSongses the user songses
	*/
	public static void cacheResult(
		java.util.List<com.mto.module.karaoke.model.UserSongs> userSongses) {
		getPersistence().cacheResult(userSongses);
	}

	/**
	* Creates a new user songs with the primary key. Does not add the user songs to the database.
	*
	* @param userSongId the primary key for the new user songs
	* @return the new user songs
	*/
	public static com.mto.module.karaoke.model.UserSongs create(long userSongId) {
		return getPersistence().create(userSongId);
	}

	/**
	* Removes the user songs with the primary key from the database. Also notifies the appropriate model listeners.
	*
	* @param userSongId the primary key of the user songs
	* @return the user songs that was removed
	* @throws com.mto.module.karaoke.NoSuchUserSongsException if a user songs with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.mto.module.karaoke.model.UserSongs remove(long userSongId)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mto.module.karaoke.NoSuchUserSongsException {
		return getPersistence().remove(userSongId);
	}

	public static com.mto.module.karaoke.model.UserSongs updateImpl(
		com.mto.module.karaoke.model.UserSongs userSongs, boolean merge)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().updateImpl(userSongs, merge);
	}

	/**
	* Returns the user songs with the primary key or throws a {@link com.mto.module.karaoke.NoSuchUserSongsException} if it could not be found.
	*
	* @param userSongId the primary key of the user songs
	* @return the user songs
	* @throws com.mto.module.karaoke.NoSuchUserSongsException if a user songs with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.mto.module.karaoke.model.UserSongs findByPrimaryKey(
		long userSongId)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mto.module.karaoke.NoSuchUserSongsException {
		return getPersistence().findByPrimaryKey(userSongId);
	}

	/**
	* Returns the user songs with the primary key or returns <code>null</code> if it could not be found.
	*
	* @param userSongId the primary key of the user songs
	* @return the user songs, or <code>null</code> if a user songs with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.mto.module.karaoke.model.UserSongs fetchByPrimaryKey(
		long userSongId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().fetchByPrimaryKey(userSongId);
	}

	/**
	* Returns all the user songses where userId = &#63;.
	*
	* @param userId the user ID
	* @return the matching user songses
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.mto.module.karaoke.model.UserSongs> findByUserId(
		long userId) throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByUserId(userId);
	}

	/**
	* Returns a range of all the user songses where userId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param userId the user ID
	* @param start the lower bound of the range of user songses
	* @param end the upper bound of the range of user songses (not inclusive)
	* @return the range of matching user songses
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.mto.module.karaoke.model.UserSongs> findByUserId(
		long userId, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByUserId(userId, start, end);
	}

	/**
	* Returns an ordered range of all the user songses where userId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param userId the user ID
	* @param start the lower bound of the range of user songses
	* @param end the upper bound of the range of user songses (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of matching user songses
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.mto.module.karaoke.model.UserSongs> findByUserId(
		long userId, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .findByUserId(userId, start, end, orderByComparator);
	}

	/**
	* Returns the first user songs in the ordered set where userId = &#63;.
	*
	* @param userId the user ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching user songs
	* @throws com.mto.module.karaoke.NoSuchUserSongsException if a matching user songs could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.mto.module.karaoke.model.UserSongs findByUserId_First(
		long userId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mto.module.karaoke.NoSuchUserSongsException {
		return getPersistence().findByUserId_First(userId, orderByComparator);
	}

	/**
	* Returns the first user songs in the ordered set where userId = &#63;.
	*
	* @param userId the user ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching user songs, or <code>null</code> if a matching user songs could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.mto.module.karaoke.model.UserSongs fetchByUserId_First(
		long userId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().fetchByUserId_First(userId, orderByComparator);
	}

	/**
	* Returns the last user songs in the ordered set where userId = &#63;.
	*
	* @param userId the user ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching user songs
	* @throws com.mto.module.karaoke.NoSuchUserSongsException if a matching user songs could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.mto.module.karaoke.model.UserSongs findByUserId_Last(
		long userId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mto.module.karaoke.NoSuchUserSongsException {
		return getPersistence().findByUserId_Last(userId, orderByComparator);
	}

	/**
	* Returns the last user songs in the ordered set where userId = &#63;.
	*
	* @param userId the user ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching user songs, or <code>null</code> if a matching user songs could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.mto.module.karaoke.model.UserSongs fetchByUserId_Last(
		long userId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().fetchByUserId_Last(userId, orderByComparator);
	}

	/**
	* Returns the user songses before and after the current user songs in the ordered set where userId = &#63;.
	*
	* @param userSongId the primary key of the current user songs
	* @param userId the user ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the previous, current, and next user songs
	* @throws com.mto.module.karaoke.NoSuchUserSongsException if a user songs with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.mto.module.karaoke.model.UserSongs[] findByUserId_PrevAndNext(
		long userSongId, long userId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mto.module.karaoke.NoSuchUserSongsException {
		return getPersistence()
				   .findByUserId_PrevAndNext(userSongId, userId,
			orderByComparator);
	}

	/**
	* Returns all the user songses where songId = &#63;.
	*
	* @param songId the song ID
	* @return the matching user songses
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.mto.module.karaoke.model.UserSongs> findBySongId(
		long songId) throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findBySongId(songId);
	}

	/**
	* Returns a range of all the user songses where songId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param songId the song ID
	* @param start the lower bound of the range of user songses
	* @param end the upper bound of the range of user songses (not inclusive)
	* @return the range of matching user songses
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.mto.module.karaoke.model.UserSongs> findBySongId(
		long songId, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findBySongId(songId, start, end);
	}

	/**
	* Returns an ordered range of all the user songses where songId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param songId the song ID
	* @param start the lower bound of the range of user songses
	* @param end the upper bound of the range of user songses (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of matching user songses
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.mto.module.karaoke.model.UserSongs> findBySongId(
		long songId, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .findBySongId(songId, start, end, orderByComparator);
	}

	/**
	* Returns the first user songs in the ordered set where songId = &#63;.
	*
	* @param songId the song ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching user songs
	* @throws com.mto.module.karaoke.NoSuchUserSongsException if a matching user songs could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.mto.module.karaoke.model.UserSongs findBySongId_First(
		long songId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mto.module.karaoke.NoSuchUserSongsException {
		return getPersistence().findBySongId_First(songId, orderByComparator);
	}

	/**
	* Returns the first user songs in the ordered set where songId = &#63;.
	*
	* @param songId the song ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching user songs, or <code>null</code> if a matching user songs could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.mto.module.karaoke.model.UserSongs fetchBySongId_First(
		long songId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().fetchBySongId_First(songId, orderByComparator);
	}

	/**
	* Returns the last user songs in the ordered set where songId = &#63;.
	*
	* @param songId the song ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching user songs
	* @throws com.mto.module.karaoke.NoSuchUserSongsException if a matching user songs could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.mto.module.karaoke.model.UserSongs findBySongId_Last(
		long songId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mto.module.karaoke.NoSuchUserSongsException {
		return getPersistence().findBySongId_Last(songId, orderByComparator);
	}

	/**
	* Returns the last user songs in the ordered set where songId = &#63;.
	*
	* @param songId the song ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching user songs, or <code>null</code> if a matching user songs could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.mto.module.karaoke.model.UserSongs fetchBySongId_Last(
		long songId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().fetchBySongId_Last(songId, orderByComparator);
	}

	/**
	* Returns the user songses before and after the current user songs in the ordered set where songId = &#63;.
	*
	* @param userSongId the primary key of the current user songs
	* @param songId the song ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the previous, current, and next user songs
	* @throws com.mto.module.karaoke.NoSuchUserSongsException if a user songs with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.mto.module.karaoke.model.UserSongs[] findBySongId_PrevAndNext(
		long userSongId, long songId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mto.module.karaoke.NoSuchUserSongsException {
		return getPersistence()
				   .findBySongId_PrevAndNext(userSongId, songId,
			orderByComparator);
	}

	/**
	* Returns all the user songses where userId = &#63; and songId = &#63;.
	*
	* @param userId the user ID
	* @param songId the song ID
	* @return the matching user songses
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.mto.module.karaoke.model.UserSongs> findByU_S(
		long userId, long songId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByU_S(userId, songId);
	}

	/**
	* Returns a range of all the user songses where userId = &#63; and songId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param userId the user ID
	* @param songId the song ID
	* @param start the lower bound of the range of user songses
	* @param end the upper bound of the range of user songses (not inclusive)
	* @return the range of matching user songses
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.mto.module.karaoke.model.UserSongs> findByU_S(
		long userId, long songId, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByU_S(userId, songId, start, end);
	}

	/**
	* Returns an ordered range of all the user songses where userId = &#63; and songId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param userId the user ID
	* @param songId the song ID
	* @param start the lower bound of the range of user songses
	* @param end the upper bound of the range of user songses (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of matching user songses
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.mto.module.karaoke.model.UserSongs> findByU_S(
		long userId, long songId, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .findByU_S(userId, songId, start, end, orderByComparator);
	}

	/**
	* Returns the first user songs in the ordered set where userId = &#63; and songId = &#63;.
	*
	* @param userId the user ID
	* @param songId the song ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching user songs
	* @throws com.mto.module.karaoke.NoSuchUserSongsException if a matching user songs could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.mto.module.karaoke.model.UserSongs findByU_S_First(
		long userId, long songId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mto.module.karaoke.NoSuchUserSongsException {
		return getPersistence()
				   .findByU_S_First(userId, songId, orderByComparator);
	}

	/**
	* Returns the first user songs in the ordered set where userId = &#63; and songId = &#63;.
	*
	* @param userId the user ID
	* @param songId the song ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching user songs, or <code>null</code> if a matching user songs could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.mto.module.karaoke.model.UserSongs fetchByU_S_First(
		long userId, long songId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .fetchByU_S_First(userId, songId, orderByComparator);
	}

	/**
	* Returns the last user songs in the ordered set where userId = &#63; and songId = &#63;.
	*
	* @param userId the user ID
	* @param songId the song ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching user songs
	* @throws com.mto.module.karaoke.NoSuchUserSongsException if a matching user songs could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.mto.module.karaoke.model.UserSongs findByU_S_Last(
		long userId, long songId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mto.module.karaoke.NoSuchUserSongsException {
		return getPersistence().findByU_S_Last(userId, songId, orderByComparator);
	}

	/**
	* Returns the last user songs in the ordered set where userId = &#63; and songId = &#63;.
	*
	* @param userId the user ID
	* @param songId the song ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching user songs, or <code>null</code> if a matching user songs could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.mto.module.karaoke.model.UserSongs fetchByU_S_Last(
		long userId, long songId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .fetchByU_S_Last(userId, songId, orderByComparator);
	}

	/**
	* Returns the user songses before and after the current user songs in the ordered set where userId = &#63; and songId = &#63;.
	*
	* @param userSongId the primary key of the current user songs
	* @param userId the user ID
	* @param songId the song ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the previous, current, and next user songs
	* @throws com.mto.module.karaoke.NoSuchUserSongsException if a user songs with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.mto.module.karaoke.model.UserSongs[] findByU_S_PrevAndNext(
		long userSongId, long userId, long songId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mto.module.karaoke.NoSuchUserSongsException {
		return getPersistence()
				   .findByU_S_PrevAndNext(userSongId, userId, songId,
			orderByComparator);
	}

	/**
	* Returns all the user songses.
	*
	* @return the user songses
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.mto.module.karaoke.model.UserSongs> findAll()
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findAll();
	}

	/**
	* Returns a range of all the user songses.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of user songses
	* @param end the upper bound of the range of user songses (not inclusive)
	* @return the range of user songses
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.mto.module.karaoke.model.UserSongs> findAll(
		int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findAll(start, end);
	}

	/**
	* Returns an ordered range of all the user songses.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of user songses
	* @param end the upper bound of the range of user songses (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of user songses
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.mto.module.karaoke.model.UserSongs> findAll(
		int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findAll(start, end, orderByComparator);
	}

	/**
	* Removes all the user songses where userId = &#63; from the database.
	*
	* @param userId the user ID
	* @throws SystemException if a system exception occurred
	*/
	public static void removeByUserId(long userId)
		throws com.liferay.portal.kernel.exception.SystemException {
		getPersistence().removeByUserId(userId);
	}

	/**
	* Removes all the user songses where songId = &#63; from the database.
	*
	* @param songId the song ID
	* @throws SystemException if a system exception occurred
	*/
	public static void removeBySongId(long songId)
		throws com.liferay.portal.kernel.exception.SystemException {
		getPersistence().removeBySongId(songId);
	}

	/**
	* Removes all the user songses where userId = &#63; and songId = &#63; from the database.
	*
	* @param userId the user ID
	* @param songId the song ID
	* @throws SystemException if a system exception occurred
	*/
	public static void removeByU_S(long userId, long songId)
		throws com.liferay.portal.kernel.exception.SystemException {
		getPersistence().removeByU_S(userId, songId);
	}

	/**
	* Removes all the user songses from the database.
	*
	* @throws SystemException if a system exception occurred
	*/
	public static void removeAll()
		throws com.liferay.portal.kernel.exception.SystemException {
		getPersistence().removeAll();
	}

	/**
	* Returns the number of user songses where userId = &#63;.
	*
	* @param userId the user ID
	* @return the number of matching user songses
	* @throws SystemException if a system exception occurred
	*/
	public static int countByUserId(long userId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().countByUserId(userId);
	}

	/**
	* Returns the number of user songses where songId = &#63;.
	*
	* @param songId the song ID
	* @return the number of matching user songses
	* @throws SystemException if a system exception occurred
	*/
	public static int countBySongId(long songId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().countBySongId(songId);
	}

	/**
	* Returns the number of user songses where userId = &#63; and songId = &#63;.
	*
	* @param userId the user ID
	* @param songId the song ID
	* @return the number of matching user songses
	* @throws SystemException if a system exception occurred
	*/
	public static int countByU_S(long userId, long songId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().countByU_S(userId, songId);
	}

	/**
	* Returns the number of user songses.
	*
	* @return the number of user songses
	* @throws SystemException if a system exception occurred
	*/
	public static int countAll()
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().countAll();
	}

	/**
	* Returns all the songs associated with the user songs.
	*
	* @param pk the primary key of the user songs
	* @return the songs associated with the user songs
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.mto.module.karaoke.model.Song> getSongs(
		long pk) throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().getSongs(pk);
	}

	/**
	* Returns a range of all the songs associated with the user songs.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param pk the primary key of the user songs
	* @param start the lower bound of the range of user songses
	* @param end the upper bound of the range of user songses (not inclusive)
	* @return the range of songs associated with the user songs
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.mto.module.karaoke.model.Song> getSongs(
		long pk, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().getSongs(pk, start, end);
	}

	/**
	* Returns an ordered range of all the songs associated with the user songs.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param pk the primary key of the user songs
	* @param start the lower bound of the range of user songses
	* @param end the upper bound of the range of user songses (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of songs associated with the user songs
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.mto.module.karaoke.model.Song> getSongs(
		long pk, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().getSongs(pk, start, end, orderByComparator);
	}

	/**
	* Returns the number of songs associated with the user songs.
	*
	* @param pk the primary key of the user songs
	* @return the number of songs associated with the user songs
	* @throws SystemException if a system exception occurred
	*/
	public static int getSongsSize(long pk)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().getSongsSize(pk);
	}

	/**
	* Returns <code>true</code> if the song is associated with the user songs.
	*
	* @param pk the primary key of the user songs
	* @param songPK the primary key of the song
	* @return <code>true</code> if the song is associated with the user songs; <code>false</code> otherwise
	* @throws SystemException if a system exception occurred
	*/
	public static boolean containsSong(long pk, long songPK)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().containsSong(pk, songPK);
	}

	/**
	* Returns <code>true</code> if the user songs has any songs associated with it.
	*
	* @param pk the primary key of the user songs to check for associations with songs
	* @return <code>true</code> if the user songs has any songs associated with it; <code>false</code> otherwise
	* @throws SystemException if a system exception occurred
	*/
	public static boolean containsSongs(long pk)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().containsSongs(pk);
	}

	public static UserSongsPersistence getPersistence() {
		if (_persistence == null) {
			_persistence = (UserSongsPersistence)PortletBeanLocatorUtil.locate(com.mto.module.karaoke.service.ClpSerializer.getServletContextName(),
					UserSongsPersistence.class.getName());

			ReferenceRegistry.registerReference(UserSongsUtil.class,
				"_persistence");
		}

		return _persistence;
	}

	/**
	 * @deprecated
	 */
	public void setPersistence(UserSongsPersistence persistence) {
	}

	private static UserSongsPersistence _persistence;
}